Parse.Cloud.define('checkRcWithdraw', async (req, res) => {
  try {
    const {ids, payload: {status}} = req.params
    if (!ids || ids.length === 0) {
      return res.error('参数不正确')
    }
    if (typeof status !== 'number' || status < -1 || status > 1) {
      return res.error('状态不正确')
    }
    const tasks = ids.map(id => new Parse.Object('RcCashRecord', {id, status}))

    await Parse.Object.saveAll(tasks)
    res.success('ok')
  } catch (err) {
    res.error(err.message)
  }
})
